import {reqGetSearchList} from '@/api'
const state = {
    searchList:[]
}
const actions = {
    async getSearchList(context,params={}){
        let result = await reqGetSearchList(params);
        // console.log(result);
        if(result.code === 200){
            context.commit('SEARCHLIST',result.data)
        }
    },
}
const mutations = {
    SEARCHLIST(state,searchList){
        state.searchList = searchList
    }
}
const getters = {
    attrsList(state){
        return state.searchList.attrsList || []
    },
    goodsList(state){
        return state.searchList.goodsList || []
    },
    trademarkList(state){
        return state.searchList.trademarkList || []
    }
}

export default ({
    state,
    actions,
    mutations,
    getters
})